.TH std::function::assign 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::function::assign \- std::function::assign

.SH Synopsis
   template< class F, class Alloc >           \fI(since C++11)\fP
   void assign( F&& f, const Alloc& alloc );  (removed in C++17)

   Initializes the target with f. The alloc is used to allocate memory for any internal
   data structures that the function might use.

   Equivalent to function(std::allocator_arg, alloc, std::forward<F>(f)).swap(*this);.

.SH Parameters

   f     - callable function to initialize the target with
   alloc - allocator to use to allocate memory for the internal data structures

.SH Return value

   \fI(none)\fP

.SH Exceptions

   May throw implementation-defined exceptions.

.SH See also

   operator= assigns a new target
             \fI(public member function)\fP
